package com.intellagric.service.search.listener;

import com.intellagric.service.search.agriecom.AgriecomProductSearch;
import org.springframework.beans.factory.annotation.Autowired;

import javax.jms.JMSException;
import javax.jms.Message;
import javax.jms.MessageListener;
import javax.jms.TextMessage;

public class ProductChangeListener implements MessageListener {
    @Autowired
    private AgriecomProductSearch productSearch;

    @Override
    public void onMessage(Message message) {
        TextMessage msg =(TextMessage)message;
        String id="";
        try {
            id=msg.getText();
            productSearch.addALL();
        } catch (JMSException e) {
            e.printStackTrace();
        }
    }
}
